import { BasicColumn, FormSchema } from '/@/components/Table';

//https://blog.csdn.net/weixin_39778003/article/details/115901447
//https://github.com/hopex/vue-menu

export interface MenuButton {
  type: string;
  name: string;
  subButtons: MenuButton[];
  url?: string;
  media_id?: string;
  appid?: string;
  pagepath?: string;
}

export interface MenuButtonType {
  type: string;
  name: string;
  value: number;
}

export const menuButtonTypes: MenuButtonType[] = [
  {
    type: 'view',
    name: '跳转网页(view)',
    value: 1,
  },
  {
    type: 'media_id',
    name: '发送消息(media_id)',
    value: 2,
  },
  {
    type: 'view_limited',
    name: '跳转公众号图文消息链接(view_limited)',
    value: 2,
  },
  {
    type: 'click',
    name: '自定义点击事件(click)',
    value: 3,
  },
  {
    type: 'scancode_push',
    name: '扫码上传消息(scancode_push)',
    value: 3,
  },
  {
    type: 'scancode_waitmsg',
    name: '扫码提示下发(scancode_waitmsg)',
    value: 3,
  },
  {
    type: 'pic_sysphoto',
    name: '系统相机拍照(pic_sysphoto)',
    value: 3,
  },
  {
    type: 'pic_photo_or_album',
    name: '弹出拍照或者相册(pic_photo_or_album)',
    value: 3,
  },
  {
    type: 'pic_weixin',
    name: '弹出微信相册(pic_weixin)',
    value: 3,
  },
  {
    type: 'location_select',
    name: '弹出地理位置选择器(location_select)',
    value: 3,
  },
  {
    type: 'miniprogram',
    name: '打开指定小程序(miniprogram)',
    value: 4,
  },
];

export const accountColumns: BasicColumn[] = [
  {
    title: '公众号名称',
    dataIndex: 'name',
    width: 200,
    align: 'left',
  },
];

export const searchAccountFormSchema: FormSchema[] = [
  {
    field: 'name',
    label: '公众号名称',
    component: 'JInput',
    colProps: { span: 24 },
  },
];

export const newsList: BasicColumn[] = [
  {
    title: '图文标题',
    dataIndex: 'title',
    width: 200,
    align: 'left',
  },
  {
    title: '日期',
    dataIndex: 'update_time',
    width: 180,
  },
];

export const materialColumns: BasicColumn[] = [
  {
    title: '素材名称',
    dataIndex: 'title',
    width: 200,
    align: 'left',
  },
];
